<?php 
#
# author: Cody Sorgenfrey with Jason Sanchez
# (c) 2012 Casa De Bendicion
#
include_once("common.php");

function galleryview_elements($image, $title) {
	$t = htmlspecialchars($title);
	return "<li><img src='".$image."' alt='".$t."' title='".$t."'></img></li>";
}

$title= "Home";
$metaKey=null;
$metaDesc="An Orphanage in Bachiniva Mexico.";
$moreHtml="";
$moreJava="
<script type='text/javascript'>
$(document).ready(function(){
	$('#myGallery').galleryView({
		transition_speed: 900,
		transition_interval:  5000,
		pause_on_hover: false,
		panel_width: 710,
		panel_height: 532,
		animate_pointer: true,
		show_filmstrip: false,
		panel_animation: 'slide',
		show_infobar: false
	});
});
</script>";

startPage($title, $metaKey, $metaDesc, $moreHtml, $moreJava, NULL);

$paragraph="Casa de Bendicion (House of Blessing) is the name of the future orphanage, located in Bachiniva, Chihuahua Mexico. There are some 10 million orphans in Mexico and our prayer and desire is to minister and care for any and all children the Lord brings into our care. We are in the process of finishing a 7300 square foot facility that will provide a new home and opportunity for these precious kids.  Our hearts desire is to see them grow in the knowledge and understanding of who Jesus is, and to understand how much God loves them.";

$text="I love the Lord, because He has heard my voice and my supplications.  Because He has inclined His ear to me, therefore I will call upon Him <br>as long as I live.";

$ref="Psalm 116:1-2";

$second = mailingBox("-204%;");

connectSelectTest("homePagePhotos");

$result = mysql_query("SELECT * FROM `homePagePhotos` ORDER BY `dateUploaded` DESC LIMIT 0,8");
while ($entry = mysql_fetch_array($result)){
	$elements .= galleryview_elements($entry['file'], $entry['title']);
}

/* $third = "<img id='house' src='/images/building1.jpg'></img>\n\n"; */
$third = "<div class='galleryview'>
		  <ul id='myGallery'>
		  ".$elements."
		  </ul>
		  </div>
";
/* $third = "<iframe width='720' height='530' src='//www.youtube.com/embed/4IeSpt3la3w' frameborder='0' allowfullscreen></iframe>"; */
	
$fourth = verseBox("-92%", $ref, $text, "verseBox");

printf("<div class='autoBox' style='width:%s; margin-top:20px; margin-left:%s;'><p>%s</p></div>\n", "98%","1%", $paragraph);
printf("<div style='margin-top:20px;'>%s</div>\n", $third);
printf("<div style='float:right;'>%s</div>\n", $second);
printf("<div style='float:right;'>%s</div>\n", $fourth);
endPage();
?>